import request from './request'

// 获取轮播图
export const getBanners = ()=>{
    return  request({url:'/banner', method:'get'})
}

// 登录
export const reqLogin = (params) =>{
    return request({url :`/login/cellphone`,params,method:'get'})
}

// 获取用户信息
export const reqUserInfo = (uid)=>{
    return request({url:`/user/detail?uid=${uid}`})
}

// 获取推荐歌单
export const reqRecommendList = ()=>{
    return request({url:`/recommend/resource`,params:{cookie:localStorage.getItem('cookie')}})
}

// 获取最新音乐
export const reqNewSongs = ()=>{
    return request({url:'/personalized/newsong',params:{limit:12}})
}

// 获取推荐mv
export const reqRecommendMv = ()=>{
    return request({url:'/personalized/mv'})
}

// 获取精品歌单
export const reqHighQualityPlayList = (params)=>{
    return request({url:'/top/playlist/highquality', params})
}

// 歌单详情
export const reqPlayListDetail = (id)=>{
    return request({url:'/playlist/detail',params:{id,cookie:localStorage.getItem('cookie')}})
}

// 歌曲详情,多个用逗号隔开
export const reqMusicDetail = (ids) =>{
    return request({url:'/song/detail', params:{ids}})
}

// 查看是否有版权
export const reqCheckMusic = (id)=>{
    return request({url:'/check/music', params:{id}})
}

// 获取用户歌单
export const reqUserPlaylist = (uid)=>{
    return request({url:'/user/playlist', params:{uid,limit:1000}})
}

// 获取所有榜单
export const reqTopList = ()=>{
    return request({url:'/toplist'})
}

// 获取歌单所有歌曲
// export const reqSongsInPlaylist = (playlistid)=>{
//     return request({url:'/playlist/track/all', params:{id:playlistid})
// }

// 测试接口
async function test(){
    let result = await reqTopList()
    console.log(result)
}
test()